package org.example.mapper;

import org.apache.ibatis.annotations.*;
import org.example.pojo.entity.Cart;

import java.util.List;

@Mapper
public interface CartMapper {

    public List<Cart> list(Cart cart);
    @Update("update cart set num = #{num} where id = #{id}")
    public void update(Cart cart);
    @Insert("insert into cart(username, goodname, num, price, id, userid, goodid, createtime)" +
            "values (#{username}, #{goodname}, #{num}, #{price}, #{id}, #{userid}, #{goodid}, #{createtime})")
    public void insert(Cart cart);
    @Delete("delete from cart where userid = #{userid}")
    public void deletebyid(Long userid);

}
